package jvm;

public class Bingfa {

    public synchronized void op1() {
        System.out.println("父1开始");
        System.out.println("父1出了");
    }

    public void op2() {
        try {
            System.out.println("2开始");
            Thread.sleep(10000);
            System.out.println("2出了");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        Bingfa bingfa = new Bingfa();
        Thread thread = new Thread(bingfa::op1);
        thread.start();
        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        bingfa.op2();
        System.out.println("11");
    }

}
